package com.hytc.mymall.frgament;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.hytc.mymall.R;
import com.hytc.mymall.base.BaseFragment;

import butterknife.BindView;
import butterknife.ButterKnife;


/**
 * Created by allkiss on 2016/12/9
 */

public class PublicWelfareConsumptionFragment extends BaseFragment implements AdapterView.OnItemClickListener ,RadioGroup.OnCheckedChangeListener {

    @BindView(R.id.iv_title_left)
    ImageView ivTitleLeft;
    @BindView(R.id.rl_back)
    RelativeLayout rlBack;
    @BindView(R.id.toolbar_title)
    TextView toolbarTitle;
    @BindView(R.id.toolbar_title_arrow)
    ImageView toolbarTitleArrow;
    @BindView(R.id.rl_title)
    RelativeLayout rlTitle;
    @BindView(R.id.tv_right_selection)
    TextView tvRightSelection;
    @BindView(R.id.iv_right_arrowdown)
    ImageView ivRightArrowdown;
    @BindView(R.id.rl_right)
    RelativeLayout rlRight;
    @BindView(R.id.rb_sixreward)
    RadioButton rbSixreward;
    @BindView(R.id.rb_twlreward)
    RadioButton rbTwlreward;
    @BindView(R.id.rb_twereward)
    RadioButton rbTwereward;
    @BindView(R.id.rg_dirtype)
    RadioGroup rgDirtype;
    @BindView(R.id.tv_gyxf_dritype)
    TextView tvGyxfDritype;
    @BindView(R.id.ptrlv_gyxf)
    ListView ptrlvGyxf;
    @BindView(R.id.ll_nodata)
    LinearLayout llNodata;


    @Override
    public void onItemClick(AdapterView<?> parent, View view, int position, long id) {

    }

    @Override
    public void initView(View view) {
        toolbarTitle.setText("爱心消费");
        toolbarTitleArrow.setVisibility(View.VISIBLE);
        rlRight.setVisibility(View.GONE);
        ptrlvGyxf.setOnItemClickListener(this);
        rgDirtype.setOnCheckedChangeListener(this);
    }

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.activity_publicwelfareconsumption, null);
        ButterKnife.bind(this, view);
        return view;
    }


    @Override
    public void onCheckedChanged(RadioGroup group, int checkedId) {
        switch (checkedId){
            case R.id.rb_sixreward:
                tvGyxfDritype.setText("6系列消费");
                llNodata.setVisibility(View.VISIBLE);//对接数据注释
            break;
            case R.id.rb_twlreward:
                tvGyxfDritype.setText("12系列消费");
                llNodata.setVisibility(View.VISIBLE);//对接数据注释
                break;
            case R.id.rb_twereward:
                tvGyxfDritype.setText("24系列消费");
                llNodata.setVisibility(View.VISIBLE);//对接数据注释
                break;
        }
    }
}
